package com.itsc.service;

import java.util.List;

import com.itsc.dao.PermissionDao;
import com.itsc.entities.Permission;
import com.itsc.service.inter.IPermissionService;
import com.opensymphony.xwork2.ActionContext;

public class PermissionService implements IPermissionService{

	private PermissionDao permissionDao;
	public void setPermissionDao(PermissionDao permissionDao) {
		this.permissionDao = permissionDao;
	}
	@Override
	public List<Permission> selectAll() {
		// TODO Auto-generated method stub
		List<Permission> list = permissionDao.selectAll();
		return list;
	}
	@Override
	public List<Permission> selectParentidNull() {
		// TODO Auto-generated method stub
		List<Permission> perList = permissionDao.selectParentidNull();
		return perList;
	}
	@Override
	public void save(Permission permission) {
		// TODO Auto-generated method stub
		permissionDao.save(permission);
	}
	@Override
	public void delete(Permission permission) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public void update(Permission permission) {
		// TODO Auto-generated method stub
		
	}
	@Override
	public Permission selectById(Integer id) {
		// TODO Auto-generated method stub
		String hql = "from Permission where per_id=?";
		Permission permission = permissionDao.selectById(hql, id);
		return permission;
	}
	@Override
	public boolean selectByString(String name) {
		// TODO Auto-generated method stub
		return false;
	}
	
}
